package com.fd.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.io.IOException;
import java.sql.*;
import java.util.Properties;

@Repository
public class BaseJDBC {

//    @Autowired
//    private Properties properties;
    //启动jdbc配置
    public static Connection connection() throws ClassNotFoundException, SQLException, IOException {

        Properties p = new Properties();
        p.load(BaseJDBC.class.getClassLoader().getResourceAsStream("setting.properties"));
        Class.forName("org.h2.Driver");
        return DriverManager.getConnection(p.getProperty("url"), p.getProperty("username"), p.getProperty("password"));
    }
}